const app = {
    namespaced: true,
    state: {
        loading: false
    },
    mutations: {
        setLoading(state, param) {
            console.log(param);
            state.loading = param;
        },
        addOrCheckedTab(state, param) {
            console.log(param);
            //检测是否重复标签页
            // var name = param.name;
            // var title = param.title;
            // var list = state.tabs.list;
            // for (var i = 0; i < list.length; i++) {
            //     var item = list[i];
            //     item.active = false;
            // }
            // //console.log('param', param);
            // var item = state.tabs.list.find(w => w.name == name);
            // if (item) {
            //     item.active = true;
            // } else {
            //     param.active = true;
            //     state.tabs.list.push(param);
            // }

            // adminTabs.setUlWidth(list.length);
            // return;
        },
        removeTab(state, param) {
            // global.$router.push({ name: state.tabs.list[param - 1].name });
            // console.log(state.tabs.list[param - 1]);
            // state.tabs.list.splice(param, 1);

            // adminTabs.setUlWidth(state.tabs.list.length);
            // return;
        },
        //菜单切换事件
        changeSiderCollapsed(state) { //, param
            state.siderCollapsed = !state.siderCollapsed;
            window.localStorage.setItem("siderCollapsed", state.siderCollapsed ? 1 : 0);
        }
    },
    actions: {
        postAuthorize(context, param) {
            // setTimeout(() => {
            //     context.commit('changePage', { page: 50 })
            // }, 2000)
        },
    },
    getters: {}
}
export default app